package client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import parm.PageParam;
import parm.ProductHotParam;
import pojo.Category;
import utils.R;

import java.util.List;

/**
 * @author zxs
 * *7 18:12
 */
@FeignClient("category-service")
public interface CategoryClient {

    @GetMapping("/category/promo/{categoryName}")
    R byName(@PathVariable String categoryName);

    @PostMapping("/category/hots")
    R hots(@RequestBody ProductHotParam productHotParam);

    @GetMapping("/category/list")
    R list();

    @GetMapping("/category/admin/list")
    List<Category> adminlist();


    @PostMapping("/category/admin/list")
    R categoryList(@RequestBody PageParam pageParam);

    @PostMapping("/category/admin/save")
    R categorySave(@RequestBody Category category);

    @PostMapping("/category/admin/remove")
    R categoryRemove(@RequestBody Category category);

    @PostMapping("/category/admin/update")
    R categoryUpdate(@RequestBody Category category);

}
